<?php
/**
 * Created by PhpStorm.
 * User: DELL
 * Date: 2019/3/4
 * Time: 11:36
 */

namespace app\admin\controller;
use app\admin\model\Admin;
use app\admin\model\Rule;
use think\Controller;
use app\admin\controller\Common;

class Index extends Controller {
    public function index(){
//        $model=new Admin();
//        $data=$model->getOne(['username'=>'admin'],'username,password');
//        echo "<pre>";
//        print_r($data);
//        echo"</pre>";
        $rule=new Rule();
        $where=['status'=>1];
        $field='id,name,title,pid';
        $data=$rule->getAll($where,$field);
        $rules=node_merge($data);
        $this->assign("rules",$rules);
        return $this->fetch();
    }
    public function welcome(){
//        $model=new Admin();
//        $data=["username"=>"admin","password"=>"admin"];
//        $res=$model->addData($data);
////        print_r($res);
        return $this->fetch();
    }
}